package com.seafwg.anno.service.impl;

import com.seafwg.anno.dao.AccountDao;
import com.seafwg.anno.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author seafwg
 * @Date 2022/3/13 1:16 上午
 * @Version 1.0
 * @description xxx
 */
@Service
public class AccountServiceImpl implements AccountService {

    // 注入Dao
    @Autowired
    private AccountDao accountDao;

    @Override
    @Transactional
    public void transfer(String divPerson, String addPerson, int money) {
        accountDao.addAccount(addPerson, money);
        int i = 100 / 0;
        accountDao.divAccount(divPerson, money);
    }
}
